#include <iostream>

using namespace std;

class Solution
{
public:
    int maxProduct(int n)
    {
        int m1 = 0, m2 = 0; // m1>m2>num
        while (n > 0)
        {
            int num = n % 10;
            n /= 10;
            if (num > m1)
            {
                m2 = m1;
                m1 = num;
            }
            else if (num > m2)
            {
                m2 = num;
            }
        }
        return m1 * m2;
    }
};

int main()
{
    cout << "Code3536" << endl;
    Solution s;
    cout << s.maxProduct(124) << endl;
    return 0;
}